﻿@model List<FOModels.Language.Language>
<script type="text/javascript">
    $(document).ready(function () {
        //
        $(".asetlanguage").click(function () {
            var appurl = $("#AppUrl").html();
            var langcode = $(this).attr("rel");
            $.ajax({
                type: "post",
                url: appurl + "/Language/AjaxLang",
                data: { lang: langcode },
                success: function (rvdata) {

                    // window.location = appurl + "/";
                    location.reload();

                }
                , error: function (a, b, errormsg) {
                    alert(errormsg);
                }
            });
            return false;
        });
    });
</script>
@if (Model.Count > 0)
{
    foreach (var lang in Model)
    {
    <a href="@Url.Action("SetLanguage", "Language", new { lang = lang.LangCode, returnUrl = "" + this.Request.RawUrl + "" })" title="@lang.Name" rel="@lang.LangCode">
        <img alt="@lang.Name" src="@Url.Content("~/Content/images/" + lang.FlagImage)" />
    </a>
        
    }
}